package org.stone926.airschool.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.stone926.airschool.bean.Course;
import org.stone926.airschool.service.CourseService;

@Controller
@RequestMapping("/course")
@CrossOrigin("*")
public class CourseController {
	@Autowired
	private CourseService courseService;

	@ResponseBody
	@RequestMapping(value = "/all/{id}", method = RequestMethod.GET)
	public List<Course> getAllCourseOfStudent(@PathVariable("id") Integer sid) {
		return courseService.getAllCourseOfStudent(sid);
	}
}
